<template>
    <view>
		<web-view title="hehe" :webview-styles="webviewStyles" 
		:src="url" 
		@message="message"
		@onPostMessage = "onPostMessage">
		</web-view>
    </view>
</template>


<script>
	
	var wv;//计划创建的webview
    export default {
		
        data() {
            return {
                webviewStyles: {
                    progress: {
                        color: '#3e3adc'
                    }
                },
				url:'',
            }
        },
		onLoad() {
			console.log('x')
			// http://api.chexiang365.net/activety/test.html?ext_code=11111
			// this.url='http://api.chexiang365.net/activety/test.html?ext_code=2020ax'
			// var u_id = this.$userFind.u_id
			// console.log(u_id)
			// // return
			// // var data = btoa(btoa(u_id))
			
			// var data_old = this.$myApi.base64_encode_api(u_id)
			// var data = this.$myApi.base64_encode_api(data_old)
			// console.log(data_new)
			const url = 'https://www.baidu.com/'
			
			// const url = 'file:///C:/Users/deng/Desktop/wwwa/demo.html'
			// const url = 'http://192.168.5.56:8080/#/h5/invit/'+data
			// const url = 'https://api.chexiang365.net/#/h5/invitInput/'+data
			
			
			console.log(url)
			this.url = url
			
		},
		onShow(){
		},
		methods:{
			onPostMessage(){
				console.log('xxxonPostMessage')
			},
			demo(){
				console.log('xxxxxxxxxx')
			},
			message(event){
				console.log('触发事件')
				const data = event.detail.data[0]
				console.log(data)
				console.log('___________')
				const action = data.action
				console.log(action)
				console.log('messagemessagemessagemessagemessage')
				uni.showModal({
				    title: '提示',
				    content: data.type,
				    success: function (res) {
				        if (res.confirm) {
				            console.log('用户点击确定');
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
				console.log(event)
				console.log('xxx')
			}
		}
    }
	
</script>

<style>

</style>
